<%@ page import="com.note.pojo.Note" %>
<%@ page import="com.note.pojo.Notetype" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <%
        Note note = (Note)pageContext.getAttribute("note");
        List<Notetype> typeList = (List<Notetype>) request.getAttribute("typeList");
    %>
    <title>Title</title>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/ueditor/ueditor.all.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/ueditor/themes/default/_css/ueditor.css"/>
    <script type="text/javascript">
        window.onload = function(){
            var ue = UE.getEditor("content")
            ue.ready(function (){
                var content = '${note.getContent()}'
                ue.setContent(content);
            });
            var v = "${note.getTypeid()}"
            $("#kind").find("option[value = '"+v+"']").attr("selected","selected");
        }
    </script>
</head>
<body>
<form action="${pageContext.request.contextPath}/editNote" method="post">
    <input type="hidden" name="userid" value="1">
    <input type="hidden" name="noteid" value="${note.getNoteId()}">
    标题:<input type="text" name="title" value="${note.getTitle()}"/>
    类别:<select id="kind" name="kind">
    <option value="-1">...</option>
    <%
        for (int i = 0; i < typeList.size(); i++) {
    %>
    <option value="<%=typeList.get(i).getTypeid()%>"><%=typeList.get(i).getTypename()%></option>
    <%
        }
    %>
</select>
    时间:<input type="text" name="time" value="">
    <script id="content" name="content" type="text/plain"></script>
    <input type="submit" value="保存">
</form>
</body>
</html>
